import Vue from 'vue'
import VueRouter from 'vue-router'
import layout from '@/views/layout'
import video from '@/views/video'
import my from '@/views/my'
import hot from '@/views/hot'
Vue.use(VueRouter)

const routes = [
	{
		path: '/',
		component: layout,
		children: [
			{
				path: '/',
				redirect: '/hot'
			},
			{
				path: '/hot',
				name: 'hot',
				component: hot,
				meta: {
					title: '热搜',
					back: false,
					tabPage: true
				}
			},
			{
				path: '/video',
				name: 'video',
				component: video,
				meta: {
					title: '热播',
					back: false,
					tabPage: true
				}
			},
			{
				path: '/my',
				name: 'my',
				component: my,
				meta: {
					title: '我的',
					back: false,
					tabPage: true
				}
			},
			{
				path: '/searchpage',
				name: 'searchpage',
				component: () => import('@/views/search'),
				meta: {
					title: '搜索',
					back: true,
					tabPage: false
				}
			}
		]
	}
]

const router = new VueRouter({
	routes
})

export default router